package top.goldenyear.porpoise.infra.job.listener;

import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.event.AppStopEndEvent;
import org.noear.solon.core.event.EventListener;
import top.goldenyear.porpoise.infra.job.service.JobService;

/**
 * @author airhead
 */
@Component
public class JobAppStopEndEventListener implements EventListener<AppStopEndEvent> {
  @Inject private JobService jobService;

  @Override
  public void onEvent(AppStopEndEvent appStopEndEvent) throws Throwable {
    jobService.stopAll();
  }
}
